<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NeuZephyr: D:/Users/Mgepahmge/Documents/C Program/NeuZephyr/include/NeuZephyr/EventPool.cuh Source File</title>
<link rel="icon" href="NZ_logo2.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="NZ_logo2.png"/></td>
  <td id="projectalign">
   <div id="projectname">NeuZephyr
   </div>
   <div id="projectbrief">Simple DL Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_a7e6ee1ae3f772c9504a0b543f2027e2.html">Mgepahmge</a></li><li class="navelem"><a class="el" href="dir_e03f57e346cc4845a4c354a35630b169.html">Documents</a></li><li class="navelem"><a class="el" href="dir_231a0482af2b83c895f27ba7fe745141.html">C Program</a></li><li class="navelem"><a class="el" href="dir_0fa7fc3a0dfd304dbfc9dce9f6facfa2.html">NeuZephyr</a></li><li class="navelem"><a class="el" href="dir_e7295b03dab2e9cdf32139bd8ec2e607.html">include</a></li><li class="navelem"><a class="el" href="dir_657344ecc65cfc28732701509f8d8421.html">NeuZephyr</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">EventPool.cuh</div></div>
</div><!--header-->
<div class="contents">
<a href="_event_pool_8cuh.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#ifndef EVENTPOOL_CUH</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="preprocessor">#define EVENTPOOL_CUH</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="preprocessor">#ifdef __CUDACC__</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="preprocessor">#include &lt;queue&gt;</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="preprocessor">#include &lt;unordered_map&gt;</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span><span class="preprocessor">#include &lt;unordered_set&gt;</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacenz_1_1cu_strm.html">nz::cuStrm</a> {</div>
<div class="foldopen" id="foldopen00165" data-start="{" data-end="};">
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_event_pool.html">  165</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classnz_1_1cu_strm_1_1_event_pool.html">EventPool</a> {</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>    <span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00191" data-start="{" data-end="}">
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_event_pool.html#a8c2753fbcb62f4c0c46dd66ad2950020">  191</a></span>        <span class="keyword">explicit</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_event_pool.html#a8c2753fbcb62f4c0c46dd66ad2950020">EventPool</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> maxEvent) : maxEvent(maxEvent) {</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>            <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; maxEvent; ++i) {</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>                cudaEvent_t e;</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>                cudaEventCreateWithFlags(&amp;e, cudaEventDisableTiming);</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>                free.insert(e);</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>            }</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>        }</div>
</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span> </div>
<div class="foldopen" id="foldopen00226" data-start="{" data-end="}">
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_event_pool.html#a78d43b63d387dadb7662168b98560e16">  226</a></span>        <a class="code hl_function" href="classnz_1_1cu_strm_1_1_event_pool.html#a78d43b63d387dadb7662168b98560e16">~EventPool</a>() {</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span>            <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> e : free) {</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span>                cudaEventDestroy(e);</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span>            }</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>            <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> e : busy) {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>                cudaEventDestroy(e);</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>            }</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>            <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> e : released) {</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span>                cudaEventDestroy(e);</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span>            }</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>        }</div>
</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span> </div>
<div class="foldopen" id="foldopen00256" data-start="{" data-end="}">
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_event_pool.html#a7cdb0eb8403303e52ad5cc5f6e2d0737">  256</a></span>        cudaEvent_t <a class="code hl_function" href="classnz_1_1cu_strm_1_1_event_pool.html#a7cdb0eb8403303e52ad5cc5f6e2d0737">recordData</a>(cudaStream_t stream, <span class="keywordtype">void</span>* data) {</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span>            std::lock_guard lock(mtx);</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>            <span class="keyword">auto</span> <span class="keyword">event</span> = acquire();</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span>            eventMap[data].insert(event);</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span>            eventMapR[event] = data;</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span>            record(stream, event);</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>            <span class="keywordflow">return</span> event;</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span>        }</div>
</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span> </div>
<div class="foldopen" id="foldopen00282" data-start="{" data-end="}">
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_event_pool.html#ac850289a3ad016430ab5b5a497f0eb19">  282</a></span>        std::unordered_set&lt;cudaEvent_t&gt; <a class="code hl_function" href="classnz_1_1cu_strm_1_1_event_pool.html#ac850289a3ad016430ab5b5a497f0eb19">getEvents</a>(<span class="keywordtype">void</span>* data) {</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno">  283</span>            std::lock_guard lock(mtx);</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno">  284</span>            <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> it = eventMap.find(data); it != eventMap.end()) {</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span>                <span class="keywordflow">return</span> it-&gt;second;</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno">  286</span>            }</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span>            <span class="keywordflow">return</span> {};</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno">  288</span>        }</div>
</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno">  289</span> </div>
<div class="foldopen" id="foldopen00309" data-start="{" data-end="}">
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_event_pool.html#a42536c96100f953868f17998a55d8543">  309</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_event_pool.html#a42536c96100f953868f17998a55d8543">syncData</a>(<span class="keywordtype">void</span>* data) {</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span>            std::unique_lock lock(mtx);</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno">  311</span>            cv.wait(lock, [<span class="keyword">this</span>, data]() -&gt; <span class="keywordtype">bool</span> {</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span>                <span class="keywordflow">return</span> eventMap.find(data) == eventMap.end();</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span>            });</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span>        }</div>
</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span> </div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span>        std::unordered_set&lt;cudaEvent_t&gt; free;</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span>        std::unordered_set&lt;cudaEvent_t&gt; busy;</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span>        std::unordered_set&lt;cudaEvent_t&gt; released;</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno">  320</span>        std::unordered_map&lt;void*, std::unordered_set&lt;cudaEvent_t&gt;&gt; eventMap;</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno">  321</span>        std::unordered_map&lt;cudaEvent_t, void*&gt; eventMapR;</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span>        <span class="keywordtype">size_t</span> maxEvent;</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno">  323</span>        std::mutex mtx;</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno">  324</span>        std::condition_variable cv;</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno">  325</span> </div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno">  343</span>        <span class="keywordtype">void</span> transfer() {</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno">  344</span>            free.insert(released.begin(), released.end());</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno">  345</span>            released.clear();</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno">  346</span>        }</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno">  347</span> </div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno">  371</span>        cudaEvent_t acquire() {</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno">  372</span>            <span class="keywordflow">if</span> (!free.empty()) {</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno">  373</span>                <span class="keyword">const</span> cudaEvent_t e = *free.begin();</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno">  374</span>                free.erase(e);</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno">  375</span>                busy.insert(e);</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno">  376</span>                transfer();</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno">  377</span>                <span class="keywordflow">return</span> e;</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno">  378</span>            }</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno">  379</span> </div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno">  380</span>            cudaEvent_t e;</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno">  381</span>            cudaEventCreateWithFlags(&amp;e, cudaEventDisableTiming);</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno">  382</span>            busy.insert(e);</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno">  383</span>            maxEvent++;</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno">  384</span>            transfer();</div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno">  385</span>            <span class="keywordflow">return</span> e;</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno">  386</span>        }</div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno">  387</span> </div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno">  406</span>        <span class="keywordtype">void</span> release(cudaEvent_t e) {</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno">  407</span>            std::lock_guard lock(mtx);</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno">  408</span>            <span class="keywordflow">if</span> (busy.find(e) != busy.end()) {</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno">  409</span>                busy.erase(e);</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno">  410</span>                released.insert(e);</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno">  411</span>            }</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno">  412</span>            <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> it = eventMapR.find(e); it != eventMapR.end()) {</div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno">  413</span>                <span class="keyword">const</span> <span class="keyword">auto</span> data = eventMapR.find(e)-&gt;second;</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno">  414</span>                eventMapR.erase(e);</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno">  415</span>                <span class="keyword">auto</span>&amp; events = eventMap.find(data)-&gt;second;</div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno">  416</span>                events.erase(e);</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno">  417</span>                <span class="keywordflow">if</span> (events.empty()) {</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno">  418</span>                    eventMap.erase(data);</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno">  419</span>                    cv.notify_all();</div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno">  420</span>                }</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno">  421</span>            }</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno">  422</span>        }</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno">  423</span> </div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno">  449</span>        <span class="keywordtype">void</span> record(cudaStream_t stream, cudaEvent_t event) {</div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno">  450</span>            cudaEventRecord(event, stream);</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno">  451</span>            cudaStreamAddCallback(stream, [](cudaStream_t, cudaError_t, <span class="keywordtype">void</span>* params) {</div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno">  452</span>                <span class="keyword">const</span> <span class="keyword">auto</span>* param = <span class="keyword">static_cast&lt;</span>std::pair&lt;EventPool*, cudaEvent_t&gt;*<span class="keyword">&gt;</span>(params);</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno">  453</span>                param-&gt;first-&gt;release(param-&gt;second);</div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno">  454</span>                <span class="keyword">delete</span> param;</div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno">  455</span>            }, <span class="keyword">new</span> std::pair(<span class="keyword">this</span>, event), 0);</div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno">  456</span>        }</div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno">  457</span>    };</div>
</div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno">  458</span>}</div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno">  459</span> </div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno">  460</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno">  461</span><span class="preprocessor">#endif </span><span class="comment">//EVENTPOOL_CUH</span></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_event_pool_html"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_event_pool.html">nz::cuStrm::EventPool</a></div><div class="ttdoc">Internal event management system for CUDA stream synchronization (Part of StreamManager)</div><div class="ttdef"><b>Definition</b> <a href="#l00165">EventPool.cuh:165</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_event_pool_html_a42536c96100f953868f17998a55d8543"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_event_pool.html#a42536c96100f953868f17998a55d8543">nz::cuStrm::EventPool::syncData</a></div><div class="ttdeci">void syncData(void *data)</div><div class="ttdoc">Synchronize the program execution with the completion of all events associated with a given data poin...</div><div class="ttdef"><b>Definition</b> <a href="#l00309">EventPool.cuh:309</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_event_pool_html_a78d43b63d387dadb7662168b98560e16"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_event_pool.html#a78d43b63d387dadb7662168b98560e16">nz::cuStrm::EventPool::~EventPool</a></div><div class="ttdeci">~EventPool()</div><div class="ttdoc">Destruct the EventPool object, releasing all managed CUDA events.</div><div class="ttdef"><b>Definition</b> <a href="#l00226">EventPool.cuh:226</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_event_pool_html_a7cdb0eb8403303e52ad5cc5f6e2d0737"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_event_pool.html#a7cdb0eb8403303e52ad5cc5f6e2d0737">nz::cuStrm::EventPool::recordData</a></div><div class="ttdeci">cudaEvent_t recordData(cudaStream_t stream, void *data)</div><div class="ttdoc">Record an event in a CUDA stream associated with a given data pointer.</div><div class="ttdef"><b>Definition</b> <a href="#l00256">EventPool.cuh:256</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_event_pool_html_a8c2753fbcb62f4c0c46dd66ad2950020"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_event_pool.html#a8c2753fbcb62f4c0c46dd66ad2950020">nz::cuStrm::EventPool::EventPool</a></div><div class="ttdeci">EventPool(const size_t maxEvent)</div><div class="ttdoc">Construct an EventPool object with a specified maximum number of events.</div><div class="ttdef"><b>Definition</b> <a href="#l00191">EventPool.cuh:191</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_event_pool_html_ac850289a3ad016430ab5b5a497f0eb19"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_event_pool.html#ac850289a3ad016430ab5b5a497f0eb19">nz::cuStrm::EventPool::getEvents</a></div><div class="ttdeci">std::unordered_set&lt; cudaEvent_t &gt; getEvents(void *data)</div><div class="ttdoc">Retrieve all CUDA events associated with a given data pointer.</div><div class="ttdef"><b>Definition</b> <a href="#l00282">EventPool.cuh:282</a></div></div>
<div class="ttc" id="anamespacenz_1_1cu_strm_html"><div class="ttname"><a href="namespacenz_1_1cu_strm.html">nz::cuStrm</a></div><div class="ttdoc">Provides core components for CUDA stream and event lifecycle management in GPU computing environments...</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
